Skip to main content

.NET RESTful Engine Common Error Fixes

This article outlines fixes for common errors you might encounter when setting up or using your .NET RESTful Engine.

The specified DSN contains an architecture mismatch

If you receive this error or something similar (i.e ""The specified DSN contains an architecture mismatch between the driver and application") this tends to mean that the driver you are using to connect to the datasource is either 32-bit or 64-bit and office or visual studios is running the opposite (i.e. 32- bit connector and 64 bit visual studio).

If you are running the report through the .NET RESTful Engine this can be easily fixed through IIS.

If the connector and office are running 32-bit and you get this error we can enable IIS to run 32 bit applications. First open up IIS and navigate to Application Pools:

Next right click on which application pool your .NET RESTful Engine is using (most likely .NET v4.5) and then click Set Application Pool Defaults. This will open a window with a bunch of properties. At the top under General is the property Enable 32-Bit Applications, we want to set that value to True.

After that, you can click OK and you should be all setup to use 32-bit applications and drivers in your .NET RESTful Engine.

Could not load file or assembly 'PDFNet.dll'

For .NET RESTful Engine versions 21.1+ you will need to install the Microsoft Visual C++ Redistributable if you get the following error when initializing the RESTful Engine:

System.IO.FileNotFoundException: Could not load file or assembly 'PDFNet.dll' or one of its dependencies.

You can get the installer from here

Request Body Larger then 4MB

These are some config settings you should adjust if you are processing larger templates and getting errors in doing so. If you have a large request body (larger than 4MB) you will need to change the following property in the web.config to match the size of your request body:

<httpRuntime maxRequestLength="4096"  executionTimeout="180"/>
  • maxRequestLength The maximum request size in kilobytes. The default size is 4096 KB (4 MB). So if you are including the actual encoded template in your request body (and its a large template), you might want to change this value (more info).

  • executionTime (in seconds) is the time before a request times out. For larger templates, posting the document may take longer than usual, so if you are seeing that the engine is timing out on posting the template, change this value (more info).

<requestLimits maxAllowedContentLength="30000000" />
  • maxAllowedContentLength specifies the maximum length of content in a request, in bytes. The default value is 30000000, which is approximately 28.6MB (more info).